#{extends 'main.html'/}
%{
    _PLATFORM_TYPE = models.accounts.AccountConstant.DIC_PLATFORM_TYPE_NAME;
}%
<div class="row wrapper  white-bg page-heading">
        <!-- <div class="wrapper wrapper-content animated fadeInRight"> -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>企业新增</h5>
                        </div>
                       
                        <div class="ibox-content">
                        #{form @accounts.Accounts.create(),method:'POST',id:'newForm',class:'form-horizontal'}
                            <div class="form-group form-inline">
                                #{f.text_field 'account.appName',label:'名称',required:'true',maxlength:10 /}
                            </div>
                            <div class="form-group form-inline">
                                #{f.text_field 'account.aliasName',label:'域名',required:'true',placeholder:'域名 (例:example.yunkefu.com)',maxlength:32 /}
                               
                            </div>
                            <div class="form-group form-inline">
                              #{f.select 'account.platformType',label:'所属平台',required:'true',dicName:_PLATFORM_TYPE,value:params['account.platformType']/}
                            </div>
                            <div class="form-group form-inline">
                                 #{f.assign 'trunknos',id:'trunkno',label:'分配号码',size:'7',unassign:editData.nos,assigned:editData.rids,labelProperty:'value',valueProperty:'key'/}
                           </div>
                                
                                <div class="form-group">
                                    <div class="col-sm-4 form-btn-area">
                                       #{f.button '保存',href:'javascript:submitForm();',class:"btn btn-primary" /}
                                       #{f.button '取消',href:@accounts.Accounts.index(),class:"btn btn-white"/}
                                    </div>
                                </div>
                           #{/form}
                        </div>
                    </div>
                </div>
            </div>
        </div>
       <script type="text/javascript">
       function submitForm(){
    	   $("select[name=trunknos]").find('option').attr('selected',true);
          $('#newForm').submit();    
       }
       </script> 